namespace ScrumSprintMonitor.UI.Wpf.ViewModels
{
	#region #using Directives

	using System.ComponentModel;
	using System.Diagnostics;

	#endregion

	[DebuggerDisplay("PieChartValue: {ValueName}={Value}")]
	public class PieChartValue<T> : INotifyPropertyChanged
	{
		private T value;
		private string valueName;

		public string ValueName
		{
			get { return this.valueName; }
			set
			{
				if (value != this.valueName)
				{
					this.valueName = value;

					OnPropertyChanged("ValueName");
				}
			}
		}

		public T Value
		{
			get { return this.value; }
			set
			{
				if (!Equals(value, this.value))
				{
					this.value = value;

					OnPropertyChanged("Value");
				}
			}
		}

		#region INotifyPropertyChanged members

		public event PropertyChangedEventHandler PropertyChanged;

		public void OnPropertyChanged(string propertyName)
		{
			if (PropertyChanged != null)
			{
				PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}

		#endregion
	}
}